package com.devframe.sys.util.common;



import org.apache.log4j.Logger;

import com.devframe.sys.util.cglib.MyBeanCopier;
import com.devframe.sys.util.cglib.MyBeanCopierContainer;
import com.devframe.sys.util.cglib.MyConverter;


public class BeanCopyUtil {
	private static Logger logger = Logger.getLogger(BeanCopyUtil.class);
	
	/**
	 * 说明：BeanUtils的属性拷贝逻辑 ,对空值不进行拷贝,而且只对简单属性进行拷贝，
	 * 简单属性见isSampleProp 如果类型不够请自己加上去
	 * copy(Object from, Object to, Converter converter);
	 * @param from
	 * @param to
	 * @return
	 */
	public static void copyBeanProperties(Object from, Object to) {
//		copyBeanAllSimpleProperties(dest, src, false);
		MyBeanCopier beanCopier=MyBeanCopierContainer.accessBeanCopier(to.getClass());
		MyConverter convert=new MyConverter(from,to,beanCopier);
		beanCopier.copy(from, to, convert);
		convert=null;
	}
	
	
	
	


	

}
